import axios from 'axios'
// import { HcMessageBox } from '../components/hcMessage/index'
// import { Toast } from 'mint-ui';
import { Notification } from 'element-ui'

axios.defaults.withCredentials=true

const $http = axios.create({
    timeout: 9999999999999, // 请求超时时间,
})

$http.interceptors.response.use((res) => {

 if(res.status == 200){
   if(res.data){
     return Promise.resolve(res);
   }
 }
  
}, (error) => {
  if(error.response){
    // Notification.error({
    //   title: '错误',
    //   message: error.response.data.detail,
    //   duration: 0
    // })
    // return Promise.reject(error.response)
    return error.response
  }
  
});

export default $http
